// chapter12.h
#ifndef _CHAPTER12_h_
#define _CHAPTER12_h_

void logCall(const std::string &funcName);
class Date
{
};

Date::Date(/* args */)
{
}

Date::~Date()
{
}

class Customer
{
public:
    Customer(const Customer &rhs);
    Customer &operator=(const Customer &rhs);

private:
    std::string name;
    Date lastTime;
}

Customer::Customer(const Customer &rhs) : name(rhs.name), lastTime(rhs.lastTime)
{
    logCall("Customer copy constructor");
}

Customer &Customer::operator=(const Customer &rhs)
{
    logCall("Customer copy assignment operator");
    name = rhs.name;
    lastTime = rhs.lastTime;
    return *this;
}

class PriorityCustomer : public Customer
{
private:
    /* data */
    int priority;
public:
    PriorityCustomer(const PriorityCustomer & rhs);
    PriorityCustomer& operator=(const PriorityCustomer &rhs);

private:
    void initPriorityCustomer(const PriorityCustomer &rhs);
};

PriorityCustomer::PriorityCustomer(const PriorityCustomer & rhs)
{
    logCall("PriorityCustomer copy constructor");
    initPriorityCustomer(rhs);
}

PriorityCustomer& operator=(const PriorityCustomer &rhs)
{
    logCall("PriorityCustomer copy assignment operator");
    initPriorityCustomer(rhs);
    return *this;
}

void PriorityCustomer::initPriorityCustomer(const PriorityCustomer &rhs){
    this->priority = rhs.priority;
    // 基类的如何复制？
}


#endif